home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw 3D / Development / Interfaces / QD3DPascalInterfaces / QD3DStorage.p < prev    next >
Encoding:
Text File  |  1996-11-15  |  4.9 KB  |  133 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DStorage.p
  3.  
  4.      Contains:    Abstraction to deal with various types of stream-based            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.0.6
  7.                  Release:    Universal Interfaces 2.1.5d1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DStorage;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DSTORAGE__}
  28. {$SETC __QD3DSTORAGE__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DStorageIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __FILES__}
  41. {$I Files.p}
  42. {$ENDC}
  43.  
  44. {$PUSH}
  45. {$ALIGN POWER}
  46. {$LibExport+}
  47.  
  48. {
  49. *****************************************************************************
  50.  **                                                                             **
  51.  **                                Storage Routines                             **
  52.  **                                                                             **
  53.  ****************************************************************************
  54. }
  55. FUNCTION Q3Storage_GetType(storage: TQ3StorageObject): TQ3ObjectType; C;
  56. FUNCTION Q3Storage_GetSize(storage: TQ3StorageObject; VAR size: LONGINT): TQ3Status; C;
  57. {
  58.  *    Reads "dataSize" bytes starting at offset in storage, copying into data. 
  59.  *    sizeRead returns the number of bytes filled in. 
  60.  *    
  61.  *    You may assume if *sizeRead < dataSize, then EOF is at offset + *sizeRead
  62. }
  63. FUNCTION Q3Storage_GetData(storage: TQ3StorageObject; offset: LONGINT; dataSize: LONGINT; VAR data: UInt8; VAR sizeRead: LONGINT): TQ3Status; C;
  64. {
  65.  *    Write "dataSize" bytes starting at offset in storage, copying from data. 
  66.  *    sizeWritten returns the number of bytes filled in. 
  67.  *    
  68.  *    You may assume if *sizeRead < dataSize, then EOF is at offset + *sizeWritten
  69. }
  70. FUNCTION Q3Storage_SetData(storage: TQ3StorageObject; offset: LONGINT; dataSize: LONGINT; {CONST}VAR data: UInt8; VAR sizeWritten: LONGINT): TQ3Status; C;
  71. {
  72. *****************************************************************************
  73.  **                                                                             **
  74.  **                             Memory Storage Prototypes                         **
  75.  **                                                                             **
  76.  ****************************************************************************
  77. }
  78. FUNCTION Q3MemoryStorage_GetType(storage: TQ3StorageObject): TQ3ObjectType; C;
  79. {
  80.  * These calls COPY the buffer into QD3D space
  81. }
  82. FUNCTION Q3MemoryStorage_New({CONST}VAR buffer: UInt8; validSize: LONGINT): TQ3StorageObject; C;
  83. FUNCTION Q3MemoryStorage_Set(storage: TQ3StorageObject; {CONST}VAR buffer: UInt8; validSize: LONGINT): TQ3Status; C;
  84. {
  85.  * These calls use the pointer given - you must dispose it when you're through
  86. }
  87. FUNCTION Q3MemoryStorage_NewBuffer(buffer: Ptr; validSize: LONGINT; bufferSize: LONGINT): TQ3StorageObject; C;
  88. FUNCTION Q3MemoryStorage_SetBuffer(storage: TQ3StorageObject; buffer: Ptr; validSize: LONGINT; bufferSize: LONGINT): TQ3Status; C;
  89. FUNCTION Q3MemoryStorage_GetBuffer(storage: TQ3StorageObject; VAR buffer: Ptr; VAR validSize: LONGINT; VAR bufferSize: LONGINT): TQ3Status; C;
  90. {
  91. *****************************************************************************
  92.  **                                                                             **
  93.  **                                Macintosh Handles Prototypes                 **
  94.  **                                                                             **
  95.  ****************************************************************************
  96. }
  97. {  Handle Storage is a subclass of Memory Storage  }
  98. FUNCTION Q3HandleStorage_New(handle: Handle; validSize: LONGINT): TQ3StorageObject; C;
  99. FUNCTION Q3HandleStorage_Set(storage: TQ3StorageObject; handle: Handle; validSize: LONGINT): TQ3Status; C;
  100. FUNCTION Q3HandleStorage_Get(storage: TQ3StorageObject; VAR handle: Handle; VAR validSize: LONGINT): TQ3Status; C;
  101. {
  102. *****************************************************************************
  103.  **                                                                             **
  104.  **                                Macintosh Storage Prototypes                 **
  105.  **                                                                             **
  106.  ****************************************************************************
  107. }
  108. FUNCTION Q3MacintoshStorage_New(fsRefNum: INTEGER): TQ3StorageObject; C;
  109. {  Note: This storage is assumed open  }
  110. FUNCTION Q3MacintoshStorage_Set(storage: TQ3StorageObject; fsRefNum: INTEGER): TQ3Status; C;
  111. FUNCTION Q3MacintoshStorage_Get(storage: TQ3StorageObject; VAR fsRefNum: INTEGER): TQ3Status; C;
  112. FUNCTION Q3MacintoshStorage_GetType(storage: TQ3StorageObject): TQ3ObjectType; C;
  113. {
  114. *****************************************************************************
  115.  **                                                                             **
  116.  **                            Macintosh FSSpec Storage Prototypes                 **
  117.  **                                                                             **
  118.  ****************************************************************************
  119. }
  120. FUNCTION Q3FSSpecStorage_New({CONST}VAR fs: FSSpec): TQ3StorageObject; C;
  121. FUNCTION Q3FSSpecStorage_Set(storage: TQ3StorageObject; {CONST}VAR fs: FSSpec): TQ3Status; C;
  122. FUNCTION Q3FSSpecStorage_Get(storage: TQ3StorageObject; VAR fs: FSSpec): TQ3Status; C;
  123. {$ALIGN RESET}
  124. {$POP}
  125.  
  126. {$SETC UsingIncludes := QD3DStorageIncludes}
  127.  
  128. {$ENDC} {__QD3DSTORAGE__}
  129.  
  130. {$IFC NOT UsingIncludes}
  131.  END.
  132. {$ENDC}
  133.